package org.jiajie.coffeecodes.concurrent.pattern.balking;

/**
 * 单次初始化
 * 
 * @author jay
 */
public class InitTest {
    boolean inited = false;
    synchronized void init(){
        if (inited){
            return;
        }
        // 省略doInit的实现
        doInit();
        inited = true;
    }

    private void doInit() {
    }
}
